home *** CD-ROM | disk | FTP | other *** search
- Path: solon.com!not-for-mail
- From: spc@gate.net (Sean 'Captain Napalm' Conner)
- Newsgroups: comp.std.c,comp.lang.c.moderated
- Subject: Re: printf() format extensions - looking for beta testers...
- Date: 20 Apr 1996 14:17:40 -0500
- Organization: CyberGate, Inc.
- Sender: clc@solutions.solon.com
- Approved: clc@solutions.solon.com
- Message-ID: <4lbd8k$m2t@solutions.solon.com>
- References: <4ksk72$rm6@solutions.solon.com> <4l33qn$7rv@solutions.solon.com> <4l3kg4$avi@solutions.solon.com>
- NNTP-Posting-Host: solutions.solon.com
-
- In article <4l3kg4$avi@solutions.solon.com> seebs@solon.com writes:
- >In article <4l33qn$7rv@solutions.solon.com>,
- >Sean 'Captain Napalm' Conner <spc@gate.net> wrote:
- >>In article <4ksk72$rm6@solutions.solon.com> seebs@solon.com writes:
- >> >In article <4kr74a$k8o@solutions.solon.com>,
- >> >Whatever you want; it's just that if you change %#, you change the behavior
- >> >of existing legal programs.
- >
- >> Existing legal programs using your printf()?
- >
- >No... I mean that, if this extension or change were adopted, the goal is that
- >all currently defined programs continue to be defined to do the same thing,
- >and the changes will affect only code using new features.
- >
- >Given that, though, if (using this extension) you were to change the behavior
- >of the # character in a printf format, previously written code would change in
- >behavior. This is a feature, sort of, but is one to be wary of.
- >
- And one I'm wary of. Again, if I use pre-written code that uses a character
- for a new format that my code wants to use, something isn't going to work
- properly (<sarcasm> and given how well Unix code is well documented
- </sarcasm>).
-
- As a defence, at least have a compile time option (or run time option) to
- flag options that are redefined, to at least warn the programmer "Thar be
- possible bugs ahead, Arrrrrrrrg! You have been warned, me mateys!"
-
- >> Again, existing code you wrote? Gee, just like make requiring tabs (and
- >>only tabs). Can't fix it, because too many make files would "break" (sorry,
- >>my anti-Unix bias is showing 8-)
- >
- >I'm not sure how a makefile using tabs would break on a make allowing
- >tabs-or-spaces, but that's atopical; feel free to email me with an example.
- >
- It's not THAT case that breaks, it's the case where using a space in a make
- that only wants tabs that breaks. And most make's I've seen are of that
- variety (in fact, I'm having to use one right now. Bug pain in the butt, with
- no other options. Arrrrrrg! Which means I'm limited to the editors I use to
- edit the makefile (and this particular lossage isn't even under Unix)).
-
- >> But you still have the problem of overloading (what if I wanted to use %<
- >>for something?).
- >
- >Then you'd change it. My current design allows you to make %d always print a
- >1. You are not required to use the standard set of flags. (This is a quality
- >of programmer issue.) The idea would be to offer some new format flags,
- >and then also provide a generic way to add new ones, or replace old ones.
- >
- >I'm hoping to get this or a similar proposal added, because it would make my
- >lifie immensely easier.
-
- And I'm afraid that it'll make my life a living hell (sorry, but I have
- enough problems working with existing poorly written C code (that I have to
- use or get to work) to fully endorse such a construct. Nothing personal).
-
- >I'm still looking at similar proposals. I have
- >decided that I'm probably going to have to choose a different way to pass data
- >around, though.
- >
- Does it HAVE to be printf()? Can't you create formatp() and use that? Or
- are you wanting to change some of the default behaviors of printf() so you (or
- someone else) don't(doesn't) have to change much code?
-
- -spc (As if there wasn't problems with *printf() already ... )
-